#! /usr/bin/python

import os
import sys

def renames(folder):
    """
        rename files in folders
    """
    files = os.listdir(folder)
    for f in files:
        nf = rules(f)
        os.rename(folder+f,folder+nf)

def rules(f):
    """
        make rename rules
    """
    f = f+'.xml'
    return f


if __name__ == '__main__':
    if( len(sys.argv)!= 2 ):
        print "usage: " + sys.argv[0]+" foldername"
        sys.exit()
    folder = sys.argv[1]
    renames(folder)
